import sqlite3

def LibDbInit(dbpath):
    conn=sqlite3.connect(dbpath)
    c=conn.cursor()
    c.execute('''CREATE TABLE record(
    ID INTEGER PRIMARY KEY,
    data DATATIME,
    class TEXT,
    tclass TEXT,
    sh TEXT,
    vp,
    tvp,
    zl1,
    zl2,
    zl3,
    zl4,
    zl5,
    t2,
    zlt)''')
    #test record
    test=(
    (2016070111,'2016-07-01',u'甲',u'日','SP1',70,70,1,2,3,4,5,7,15),
    (2016070112,'2016-07-01',u'甲',u'日','SP2',60,60,6,5,4,3,2,14,20),
    (2016070113,'2016-07-01',u'甲',u'日','SP3',50,50,1,0,2,3,4,4,10),
    (2016070114,'2016-07-01',u'甲',u'日','SP4',40,40,5,6,7,8,9,19,35),
    (2016070115,'2016-07-01',u'甲',u'日','SP5',30,30,2,3,1,2,3,7,11),
    (2016070116,'2016-07-01',u'甲',u'日','SP6',20,20,1,3,5,7,1,11,17),
    (2016070117,'2016-07-01',u'甲',u'日','SP7',10,10,4,0,2,0,1,4,7))
    for r in test:
        c.execute("INSERT INTO record VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)",r)    
    conn.commit()
    c.close()
    conn.close()
        
if __name__=="__main__":
        dbpath='zlpsql.db'
        LibDbInit(dbpath)
 
